package com.codefish.framework.spring.beans.exception;

import com.codefish.framework.spring.beans.factory.support.BeanReference;

/**
 * @author <a href='https://gitee.com/hzf2281'>codefish</a>
 * @version 1.0.0
 * @since 2022/09/29 下午 03:11
 */
public class SetBeanPropertyException extends BeansException {
    public SetBeanPropertyException(String beanName, String fieldName, Object value) {
        super(String.format("初始化beanName为'%s'的bean时异常，设置属性'%s'的值为[%s]时失败", beanName, fieldName, value));
    }

    public SetBeanPropertyException(String beanName, String fieldName, BeanReference br) {
        super(String.format("初始化beanName为'%s'的bean时异常，设置属性'%s'失败,找不到依赖的beanName或类型不匹配:'%s'", beanName, fieldName, br.getBeanName()));
    }
}
